declare var require: any;
const Highcharts = require('highcharts');

export let ChartSchema: any = {
  global: {
    timezoneOffset: -8 * 60,
  },
  lang : {
    months : ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
    shortMonths : ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
    weekdays : ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
    rangeSelectorZoom: '',
    rangeSelectorFrom: '',
    rangeSelectorTo: '到'
  },
  buttons: [
    {
      type: 'week',
      count: 1,
      text: '一星期'
    },

    {
      type: 'month',
      count: 1,
      text: '一个月'
    },

    {
      type: 'month',
      count: 6,
      text: '六个月'
    },

    {
      type: 'month',
      count: 12,
      text: '一年'
    },

    {
      type: 'all',
      text: '全部'
    }
  ],
  colors: ['#58B861', '#9279F5', '#13C2C2', '#FB7F54', '#90653E'],
  credits: false,
  series: [
    {
     type:'area',
     name: '策略收益',
     lineWidth: 1,
     color: '#2090FF',
     tooltip: {
      dateTimeLabelFormats:{day:'%Y-%m-%d,%A'},
      valueDecimals:2,
      valueSuffix:'%'
     },
     fillOpacity: .2,
     id: 'returnseries',
     data:[]
   },

   {
     name: '基准收益',
     color: '#CE2D30',
     lineWidth: 1,
     tooltip: {
       dateTimeLabelFormats:{day:'%Y-%m-%d,%A'},
       valueDecimals:2,
       valueSuffix:'%'
     },
     data: []
   },

   {
     name: '超额收益',
     visible: false,
     color: '#FBA641',
     lineWidth: 1,
     tooltip: {
        dateTimeLabelFormats:{day:'%Y-%m-%d,%A'},
        valueDecimals:2,
        valueSuffix:'%'
     },
     data: []
   }
  ],

  navigator: {
    series: {
     color: 'transparent',
     lineWidth: 0
    },
    height: 20,
    maskFill: '#ecf2fa',
    xAxis: {
     dateTimeLabelFormats: {
       day: '%b %e',
       week: '%b %e',
       month: '%b %Y'
     }
    }
  },

  plotOptions: {
    series: {
      turboThreshold: 0,
      connectNulls: true,
      marker: {
        states: {
        hover: {
          enabled: !0,
          radius: 4
        }
      },
      symbol: 'circle'
     },
     animation: !1
    }
  },

  title: {
    text : ''
  },

  tooltip: {
    split: false,
    shared: true,
    backgroundColor: 'rgba(255,255,255,0.88)',
    borderWidth: 0,
    borderRadius: 1,
    style: {
      boxShadow: '0 2px 8px 0 rgba(0,0,0,0.16)'
    },
    padding: 14,

    dateTimeLabelFormats:{day:'%Y-%m-%d,%A'},
    valueDecimals:2,
    valueSuffix:'%',
    useHTML: true,
    pointFormatter: function() {
      return this.text;
    }
  },

  yAxis: [
    {
      height: '100%',
      lineWidth: 1,
      title: {
        text: '累计收益'
      },
      tickPixelInterval:20,
      minorGridLineWidth: 1,
      minorTickWidth: 0,
      opposite: !0,
      plotLines: [
        {
        value: 0,
        color: 'black',
        width: 2
        }
      ],
      labels: {
        align: 'right',
        x: -3,
        formatter: function () {
          let yAxisValue = this.value;
          return '<div>' + this.value + '%</div>';
        }
      }
    }
  ]
}
